package ups.glre.news.service;

import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;

import javax.ejb.Local;

import ups.glre.news.model.News;

@Local
public interface NewsService {
	
	public News createNews(int userId, int categoryId, String title, String content ) ;
	
	public void deleteNews(int newsId);
	
	public News UpdateNews(int newsId,int categoryId, String title, String content);	
	
	public List<News> getAllNews();
	
	public List<News>getNewsByDate(GregorianCalendar date);
	
	public List<News> getNewsByCategory(int categoryId);
	
	public List<News> getNewsByAuthor(int userId);

	public News getGetNews(int newsId);

	public void deleteNews(News news);

	/**
	 * Method called by web service
	 * @param login
	 * @param categoryName
	 * @param title
	 * @param content
	 * @return
	 */
	public News createNews(String login, String categoryName, String title,
			String content)throws Exception;
	
}
